#pragma once

#include "PID.h"

typedef struct {
	PID::Spid wingLeveler,headingHold,pitchHold,climbHold,altHold,throttleHold,slipHold;
} SpidConstants;

typedef struct {
	int min,max;
	bool inverted;
} SservoCalib;

typedef struct {
	SservoCalib ail,elev,thr,rud;
} SservoAllCalib;

class EEPROMmanager
{
public:
	static void writePIDconstants(SpidConstants input);
	static SpidConstants readPIDconstants();
	static void writeServoCalibrations(const SservoAllCalib &calib);
	static SservoAllCalib readServoCalibrations();
private:
	template <class T>
	static void writeTemplate(const T &input, unsigned int pos);
	template <class T>
	static T readTemplate(unsigned int pos);
};
